package com.core.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.core.pojo.StockDo;
import org.apache.ibatis.annotations.Update;

/**
 * @author SunChangSheng
 * @apiNote
 * @since 2021/8/18 18:45
 */
public interface StockMapper extends BaseMapper<StockDo> {
    /**
     * 减库存
     * @param id
     * @return
     */
    @Update("update t_stock set num=num-1 where id=#{id}")
    int reduceStock(int id);
}
